load("//bazel:mongo_src_rules.bzl", "idl_generator", "mongo_cc_library")

package(default_visibility = ["//visibility:public"])

exports_files(
    glob([
        "*.h",
        "*.cpp",
    ]),
)

idl_generator(
    name = "stage_memory_limit_knobs_gen",
    src = "stage_memory_limit_knobs.idl",
    hdrs = [
        "knobs_protector.h",
    ],
    deps = [
        "//src/mongo/db:basic_types_gen",
    ],
)

mongo_cc_library(
    name = "stage_memory_limit_knobs",
    srcs = [
        "knobs.cpp",
        "stage_memory_limit_knobs_gen",
    ],
    local_defines = ["QUERY_STAGE_MEMORY_LIMITS_KNOBS_PRIVATE_OVERRIDE"],
    deps = [
        "//src/mongo/db:server_base",
        "//src/mongo/db/query:on_parameter_change_updaters",
    ],
)
